package cn.jflow.boot.controller.App;

import bp.App.SDJDJ.Handler_GGZL;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 山东监督局
 */
@RestController
@CrossOrigin(maxAge = 3600)
@RequestMapping("/WF/SDJDJ")
public class SDJDJController {


    /**
     * 获取蓝天云数据
     * @throws Exception
     */
    @CrossOrigin(origins = "*")
    @GetMapping("/queryData")
    public String queryData(String stime,String etime){
        try{
            System.out.println(stime+"进入1,"+etime);
            Handler_GGZL.DownloadData(stime,etime);
            System.out.println("退出1,");
        }catch (Exception e){
            return e.getMessage();
        }
        return "获取成功";
    }
    /**
     * 插入蓝天云数据
     * @throws Exception
     */
    @CrossOrigin(origins = "*")
    @GetMapping("/saveData")
    public String saveData(){
        try{
            System.out.println("进入2,");
            Handler_GGZL.ReadDataAndStartFlow();
            System.out.println("退出2,");
        }catch (Exception e){
            return e.getMessage();
        }
        return "保存成功";
    }

    public static void main(String[] args) {
    }
}

